#ifndef YOOHOO_XMPPCORE_MESSAGEPARSERFACTORY_H
#define YOOHOO_XMPPCORE_MESSAGEPARSERFACTORY_H

#include "xmppcore/stanzaparser.h"
#include "xmppcore/message.h"

namespace yoohoo_xmppcore {

class MessageParser : public StanzaParser {
public:
	MessageParser();
	bool processText(QString path, QString text);

protected:
	bool doProcessAttributes(QString path, QList<ParsingAttribute> attributes);
	Stanza* stanza();
	bool setType(QString sType);

protected:
	Message* _message;
	XmlLangText _subject;
	XmlLangText _body;

private:
	static const QString PATH_MESSAGE_SUBJECT;
	static const QString PATH_MESSAGE_BODY;
	static const QString PATH_MESSAGE_THREAD;
};

class MessageParserFactory : public XmppParserFactory {
public:
	XmppParser* createParser();
	ProtocolKey protocolKey();
};

}

#endif
